<template>
  <f7-page>
    <f7-navbar title="吉林动画学院用章申请表" back-link=""></f7-navbar>

    <f7-list form>
      <f7-list-item>
        <f7-label>名称</f7-label>
        <f7-input type="text" :value="formContent.title" :disabled="true"></f7-input>
      </f7-list-item>
      <f7-list-item >
        <f7-label>申请部门</f7-label>
        <f7-input type="select" placeholder="Please choose..." :value="formContent.orgName"    :disabled="true" >
          <option value="动画工程中心" selected>动画工程中心</option>
        </f7-input>
      </f7-list-item>
      <f7-list-item  >
        <f7-label>用印数</f7-label>
        <f7-input  type="tel" placeholder=""  v-bind:value="formContent.usageCount" :disabled="true"></f7-input>
      </f7-list-item>
      <f7-list-item  >
        <f7-label>印章类别</f7-label>
        <f7-input type="select" placeholder="Please choose..." :value="formContent.sealType" :disabled="true">
          <option v-for="(value, index) in sealNum" v-bind:key="index" v-bind:value="index">{{value}}</option>

        </f7-input>
      </f7-list-item>
      <f7-list-item  >
        <f7-label>备注</f7-label>
        <f7-input type="textarea" placeholder="Input here please" :value="formContent.remark" :disabled="true"></f7-input>
      </f7-list-item>
    </f7-list>
  </f7-page>
</template>

<script>
    export default {
      name: "sealApplyView",
      data() {
        return {
          sealNum: this.GLOBAL.sealNum,
          pastMemory: {},
          formContent: {
            title: "吉林动画学院用章申请表",
            createBy: sessionStorage.getItem('userName'),
            usageCount: 0,
            sealTypeName: "",
            sealType: 1,
            sealAdministrator: "",
            remark: "",
            orgName: "动画工程中心",
            orgId: 20769,
            generalManager: "",
            departmentHead: "",
            auditResult: "流程尚未启动",
          }
        }
      },
      mounted() {
        this.$f7ready((f7) => {
          let that = this;
          f7.request.setup({
            headers: {
              'AccessToken': sessionStorage.getItem('accessToken'),
              'JSESSIONID': sessionStorage.getItem('userToken'),
            }
          });
          //console.log( "id:" + that.$f7route.params.id )
          f7.request.json(that.GLOBAL.RequestAddress + '/camel/rest/sealapplys', {
            'page': 1,
            'limit': 10,
            'jsonStr': '',
            'otherStr': '',
            'start': '0'
          }, function (result) {
            if (result.totalCount >0) {
              for (let pm of result.data) {
                if (pm.id == that.$f7route.params.id) {
                  that.pastMemory = pm;
                  break;
                }
              }
              if (Object.keys(that.pastMemory).length === 0) {
                return;
              } else {
                that.formContent.title = that.pastMemory.title;
                that.formContent.usageCount = that.pastMemory.usageCount;
                that.formContent.orgName = that.pastMemory.orgName;
                that.formContent.orgId = that.pastMemory.orgId;
                that.formContent.sealTypeName = that.pastMemory.sealTypeName;
                that.formContent.sealType = that.pastMemory.sealType;
                that.formContent.sealAdministrator = that.pastMemory.sealAdministrator;
                that.formContent.remark = that.pastMemory.remark;
                that.formContent.generalManager = that.pastMemory.generalManager;
                that.formContent.departmentHead = that.pastMemory.departmentHead;
              };
            }
          })
        });
      },
    }
</script>

<style scoped>

</style>
